package com.tubi.String;

import java.util.Scanner;

public class 统计字符出现的次数 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符串");
        String s = sc.nextLine();

        char[] chars = s.toCharArray();

        int A = 0;
        int b = 0;
        int s1 = 0;
        int buzhidao = 0;
        for (int i = 0; i < chars.length; i++) {
            char ch = chars[i];
            if(ch >= 'A' && ch <= 'Z'){
                A++;
            }else if(ch >= 'a' && ch <= 'z'){
                b++;
            }else if (ch>='0' && ch<='9'){
                s1++;
            }else {
                buzhidao ++;
            }
        }
        System.out.println("大写"+A);
        System.out.println("小写"+b);
        System.out.println("数字"+s1);
        System.out.println("不知道"+buzhidao);
    }
}
